#include "HistoryHandler.h"

void HistoryHandler::recvHistoryMsg(const QByteArray& data) {
    historyList.clear();
    QByteArrayList records = data.split(';');
    for (const QByteArray& record : records) {
        QByteArrayList fields = record.split(',');
        if (fields.size() < 2) continue;
        History history(fields[0].toUInt(), fields[1]);
        historyList.append(history);
    }
}